﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

namespace MetroGTD.Model
{
    public class Thing
    {
        public int ID { get; set; }
        [Required(ErrorMessage = "Title is missing")]
        public string Title { get; set; }
        [MaxLength(150, ErrorMessage = "Max Length Exceeded")]
        public string Details { get; set; }
        public DateTime? DueDate { get; set; }
        public bool IsDone { get; set; }

        public virtual Project Project { get; set; }
        public virtual ICollection<Tag> Tags { get; set; } 
    }

    public class Tag
    {
        public int ID { get; set; }
        [Required(ErrorMessage = "Tag Name is missing")]
        public string Title { get; set; }
        public virtual ICollection<Thing> Things { get; set; }
    }

    public class Project
    {
        public int ID { get; set; }
        [Required(ErrorMessage = "Project title is required")]
        public string Title { get; set; }
        public DateTime? DueDate { get; set; }
        public bool IsDone { get; set; }

        public virtual ICollection<Thing> Things { get; set; }
    }
}
